Skip to content

Upgrade linkml-reference-validator to 0.3.0 - #4552

Closed
cmungall wants to merge 8 commits into
mainfrom
claude/confident-shannon-vfz0tz
Closed

cmungall wants to merge 8 commits into
mainfrom
claude/confident-shannon-vfz0tz

Conversation

@cmungall

Copy link
Copy Markdown
Member

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SfBE3uVPNyHBBofmRvNakd

claude added 5 commits October 6, 2026 14:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SfBE3uVPNyHBBofmRvNakd
linkml-reference-validator 0.3.0 contains the upstream frontmatter
delimiter fix, so the version-gated backport and its reference_cli
entry point are removed and callers use the upstream CLI directly.

0.3.0 also treats any cache entry without a current extractor_version
stamp as stale and re-fetches and rewrites it during validation. Almost
every committed publications/ entry is unstamped, so set
trust_cached_entries in the repo configs and direct-validator scripts:
validation now reads the reviewed cache as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SfBE3uVPNyHBBofmRvNakd
- test_fetch_pubmed_data cached PMID_29727692.md into the repo's
  publications/ on every integration run (cassette replay included);
  it now caches to tmp_path.
- seed_missing_annotations hard-coded Path("publications") for title
  fetches, so fetch_gene_data(base_path=tmp) still wrote publications
  into the working directory. It takes publications_dir, and
  fetch_gene_data passes base_path / "publications" (unchanged for the
  CLI, where base_path is the working directory).
- conftest snapshots git status of publications/ and genes/ at session
  start and fails the run if any test changed them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SfBE3uVPNyHBBofmRvNakd
The BAG6 refresh test replaces seed_missing_annotations with a stub that
did not accept the new keyword. It now records publications_dir and
asserts fetch_gene_data passes base_path / "publications".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SfBE3uVPNyHBBofmRvNakd
@ai4c-reviewer

ai4c-reviewer Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

1 similar comment
@ai4c-reviewer

ai4c-reviewer Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 6m 29s —— View job


Review: Upgrade linkml-reference-validator to 0.3.0

  • Gather PR diff and context
  • Review removed compat shims (reference_cache_compat.py, reference_cli.py)
  • Review config changes (.linkml-reference-validator.yaml, conf/reference_validator_config.yaml)
  • Review etl/gene.py + goa_validator.py publications_dir plumbing
  • Review test/conftest isolation changes
  • Check CI results
  • Post review

Scope note: this PR touches dependency/infra code only — no *-ai-review.yaml, module, or GO-CAM files change. The curation-specific checklist items below are therefore N/A, not "passed".

  • Schema validation passes — ❌ just validate-all fails (details below)
  • All PMIDs verified as real — N/A (no curation changes)
  • Supporting text matches publication content — N/A (but see 🔴 below: 0.3.0 newly rejects 18 existing snippets)
  • GO terms correct and specific — N/A
  • Review actions well-justified — N/A
  • Core functions accurately identified — N/A
  • No over-annotation issues missed — N/A

🔴 CRITICAL — CI is red, and the test suite never ran

Build and test #38038470526 fails at step 15 Validate gene reviews (scoped). Because this PR touches src/, the step widened to the whole corpus (6,603 files) and the reference phase reported 67 issues in 39 files. scripts/run_reference_validator.sh:35-38 only tolerates warning-only output, so the 18 [ERROR] findings fail the whole batch:

error class count
Supporting text is empty once editorial brackets and '...' separators are removed 12
Supporting text is empty: an excerpt must quote actual text from the reference 6

Affected files: ANOGA/TEP10 (2), MYCTU/Rv0898c, SCHPO/ago1, SCHPO/tim10, human/GCDH, human/OXCT1, human/SFT2D3, human/SLC25A24, human/WIPF1, worm/cebp-2 (7), worm/pink-1.

These are real pre-existing defects that 0.2.1 silently accepted — the new check is a genuine win. E.g. genes/worm/cebp-2/cebp-2-ai-review.yaml:128, :146, :163, :180, :196 hold bracket-only pseudo-quotes:

supporting_text: '[UniProtKB keyword mapping for DNA-binding bZIP transcription factor]'
supporting_text: '[InterPro domain mapping for bZIP domain (IPR004827), ...]'

A quote made entirely of editorial brackets quotes nothing, which is exactly what 0.3.0 says. But the upgrade can't land until the corpus is clean. Per CLAUDE.md the convention is to fix, never baseline ("fix them and run just local-quote-baseline --prune, never add to it"), so these 11 files need real excerpts, or the provenance moved out of supporting_text (review.reason / notes) where it belongs for IEA/IBA rows.

Second, consequential point: step 15 failing meant step 27 Run test suite was skipped. Every test this PR adds or rewrites — the conftest.py protected-tree guard, test_seed_missing_annotations_uses_given_publications_dir, the trust_cached_entries assertions — is unverified in CI.

Fix this →

🟡 IMPORTANT — the <0.3 ceiling existed to guard a private API; raising it to <0.4 is unverified

pyproject.toml:49-51 keeps the original rationale while moving the bound past it:

# <0.3: publication_warm.py calls LRV's private ReferenceFetcher._materialize;
# lift the bound once a public API lands (tracked in issue #2789).
"linkml-reference-validator>=0.3.0,<0.4",

publication_warm.py:401 still calls fetcher._materialize(location) and unpacks a 4-tuple, _materialize is still private, and issue #2789 is still open — so the stated condition for lifting the bound has not been met. publication_warm.py:397 likewise still asserts "pyproject bounds LRV <0.3 until it lands". Nothing in tests/ touches _materialize, so a signature change in 0.3.0 would surface only as a runtime warning inside the warm sweep's except Exception handler. Either add a test pinning the call shape, or state in the comment why crossing 0.3 is safe — and update both comments so they stop contradicting the pin.

🟡 IMPORTANT — trust_cached_entries: true may neuter just warm-references

scripts/warm_reference_cache.py:28 passes --config conf/reference_validator_config.yaml, which now sets trust_cached_entries: true. That script's entire stated purpose (:5-10) is the opposite:

When a cached entry has no full text yet, the validator re-fetches it every run … Running the validator once over the whole corpus with full-text fetching on … populates the cache.

If trust_cached_entries suppresses re-fetch for any already-present entry (not just ones failing the extractor_version check), then the warm sweep and the nightly Warm reference cache workflow stop upgrading abstract-only entries to full text. I could not verify LRV 0.3.0's exact semantics here (no resolved venv in this sandbox), so please confirm — and if it does suppress them, give the warming path a config without the flag, since warming is the one place where deliberate refetch is the intent.

🔵 SUGGESTIONs

  1. tests/test_reference_cache.py:57 — the @pytest.mark.parametrize("newline", ["\n", "\r\n"]) was dropped from test_in_process_title_quote_and_cache_preservation. CRLF is the precise case the deleted backport existed to handle; now that you're trusting the upstream fix instead of vendoring it, that's the assertion most worth keeping. (CRLF coverage survives only in test_full_text_utility_rejects_invalid_metadata, which exercises a different path.)
  2. tests/conftest.py:625 — session.exitstatus = pytest.ExitCode.TESTS_FAILED overwrites unconditionally, so an INTERNALERROR/INTERRUPTED/USAGE_ERROR run gets downgraded to a plain test failure. Only escalate when the current status is OK.
  3. tests/conftest.py:615 — set(after) - set(before) is one-way, so a test that reverts a pre-existing modification changes the status, produces an empty changed, and reports the vague "(status changed for already-modified files)". A symmetric difference would name the lines that disappeared too.
  4. scripts/run_reference_validator.sh:13 — header still says "Requires linkml-reference-validator >= 0.2.1"; the floor is now 0.3.0.

What's good

  • No dangling references to the deleted reference_cache_compat / reference_cli modules anywhere in the tree (justfile, workflows, scripts, docs all clean), and dropping docs/licenses/linkml-reference-validator-Apache-2.0.txt is correct now that no vendored code remains. Deleting 417 lines of version-gated monkeypatching is the right call.
  • The publications_dir plumbing closes a real hole. goa_validator.seed_missing_annotations hardcoded Path("publications"), so seeding from any other cwd read and wrote the wrong cache; etl/gene.py:626,1813 now pass base_path / "publications". test_seed_missing_annotations_uses_given_publications_dir is well constructed — seeding a fixture PMID_12345.md whose title differs from the committed one makes a leak to the real cache visibly wrong rather than silently passing.
  • test_repo_configs_trust_committed_cache reads both YAML files directly, which is the right way to stop the two configs drifting apart silently.

Verdict: requesting changes — chiefly the red validate-all, which needs the 11 files cleaned up in this PR so the gate (and the skipped test suite) actually runs.
· branch claude/confident-shannon-vfz0tz

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infra-only PR (no curation YAML changed), so the GO-term/evidence checks are N/A. Two blocking items:

🔴 CI is red. Build and test run 38038470526 fails at step 15 (Validate gene reviews, widened to all 6,603 files because src/ changed). LRV 0.3.0 adds two error classes for empty supporting_text and reports 18 [ERROR] findings in 11 files: ANOGA/TEP10 (2), MYCTU/Rv0898c, SCHPO/ago1, SCHPO/tim10, human/GCDH, human/OXCT1, human/SFT2D3, human/SLC25A24, human/WIPF1, worm/cebp-2 (7), worm/pink-1. scripts/run_reference_validator.sh only tolerates warning-only output, so the batch fails.

These are real pre-existing defects that 0.2.1 accepted — e.g. genes/worm/cebp-2/cebp-2-ai-review.yaml:128,146,163,180,196 hold bracket-only pseudo-quotes like '[InterPro domain mapping for bZIP domain (IPR004827)]'. The new check is a genuine win; the corpus just has to be cleaned before the upgrade can land. Per CLAUDE.md, fix rather than baseline: supply verbatim excerpts, or move the provenance note into review.reason.

Knock-on effect: step 15 failing meant step 27 'Run test suite' was skipped, so every test this PR adds (the conftest protected-tree guard, test_seed_missing_annotations_uses_given_publications_dir, the trust_cached_entries assertions) is unverified in CI.

🟡 The <0.3 ceiling guarded a private API; <0.4 is unverified. publication_warm.py:401 still calls the private fetcher._materialize(location) and unpacks a 4-tuple, issue #2789 is still open, and no test pins the call shape — so the stated condition for lifting the bound hasn't been met. pyproject.toml:49 and publication_warm.py:397 both still say '<0.3', contradicting the new pin.

🟡 trust_cached_entries may neuter warm-references. scripts/warm_reference_cache.py passes conf/reference_validator_config.yaml, which now sets trust_cached_entries: true — but that script exists precisely to re-fetch entries that have no full text yet (see its docstring). Please confirm LRV 0.3.0's semantics; if trust suppresses re-fetch for any present entry, give the warming path a config without the flag.

Suggestions (non-blocking): restore the ['\n','\r\n'] parametrization on test_in_process_title_quote_and_cache_preservation (CRLF is the case the deleted backport existed for); only escalate session.exitstatus when it is OK; use a symmetric set difference in the conftest guard's diff message; update the '>= 0.2.1' header in run_reference_validator.sh.

Good parts: no dangling references to the deleted modules anywhere, the license-file removal is correct now the vendored code is gone, deleting 417 lines of version-gated monkeypatching is the right call, the publications_dir plumbing closes a real cwd-dependent cache-leak hole with a well-constructed test, and test_repo_configs_trust_committed_cache reading both YAMLs directly is the right guard against config drift.

Full detail: #4552 (comment)

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 7m 9s —— View job


Re-review: Upgrade linkml-reference-validator to 0.3.0

  • Gather diff since last review
  • Inspect the snippet edits in all 11 files
  • Verify the two replacement quotes are verbatim in their sources
  • Check whether provenance was lost by the deletions
  • Re-check the <0.4 bound / _materialize concern
  • Re-check trust_cached_entries vs warm-references
  • Check history records
  • Check CI
  • Post review

Scope note: the new commit touches curation YAML, but only to delete/replace unverifiable supporting_text placeholders — no GO term, action, or core_functions entry changes. So the term/evidence checklist is N/A, not "passed".

  • Schema validation passes — ⏳ unknown; see below
  • All PMIDs verified as real — N/A (no new citations)
  • Supporting text matches publication content — ✅ the two new quotes verified verbatim (below)
  • GO terms correct and specific — N/A
  • Review actions well-justified — N/A (no action changed)
  • Core functions accurately identified — N/A
  • No over-annotation issues missed — N/A

✅ The snippet cleanup is done correctly, and I verified what's verifiable

Twenty-two placeholder snippets were removed across the 11 flagged files (more than the 18 CI reported — harmless over-cleaning in the same subtrees). The important thing is that no provenance was actually lost: in every supported_by deletion the removed entry pointed at the same GO_REF already recorded in original_reference_id on that annotation. E.g.

  • genes/worm/cebp-2/cebp-2-ai-review.yaml:116 keeps original_reference_id: GO_REF:0000043; the deleted supported_by: [{reference_id: GO_REF:0000043, supporting_text: '[UniProtKB keyword mapping …]'}] was a self-referential restatement of the evidence line with a fabricated quote attached. Same for :130 (GO_REF:0000002) and genes/worm/pink-1/pink-1-ai-review.yaml:111 (GO_REF:0000033).

Both genuine replacements check out as verbatim substrings of their cited local source:

  • genes/human/SFT2D3/SFT2D3-ai-review.yaml:80-81 → SFT2D3-uniprot.txt:120 is exactly DR GO; GO:0005737; C:cytoplasm; IEA:UniProtKB-ARBA. ✅ — and this is a genuinely better citation than the old '[ARBA machine learning prediction based on sequence features]', because the DR line documents the ARBA assignment itself while GO_REF:0000117 survives on original_reference_id.
  • genes/human/WIPF1/WIPF1-ai-review.yaml:928-929 → WIPF1-deep-research-falcon.md:174 contains immune synapse defects, variable thrombocytopenia, and occasionally malignancy ✅.

History coverage is complete: one record per edited gene (11), schema-shaped like the existing records, all linked to PR #4552.

⏳ BLOCKING-UNKNOWN — I cannot confirm validate-all is green

Build and test 38045976514 is still on step 15 Validate gene reviews (scoped) after ~55 min (widened to the whole corpus because src/ changed). No step has failed yet, and the earlier 18 [ERROR]s are plausibly all gone — but the gate hasn't reported, and step 27 Run test suite still hasn't started, so this PR's new tests remain unverified in CI. The verdict below should be re-read once step 15 lands.

I could not run the validator locally to pre-empt this: there is no uv and no resolved venv in this sandbox.

🟡 IMPORTANT — three items from the last review are untouched (no commit addressed them)

The only new commit is the snippet cleanup, so these all still stand verbatim:

  1. pyproject.toml:49-51 contradicts its own pin. The comment still reads # <0.3: publication_warm.py calls LRV's private ReferenceFetcher._materialize; lift the bound once a public API lands (tracked in issue #2789) immediately above "linkml-reference-validator>=0.3.0,<0.4". publication_warm.py:401 still calls fetcher._materialize(location) and unpacks a 4-tuple, and publication_warm.py:397-398 still says "pyproject bounds LRV <0.3 until it lands". Nothing in tests/ pins that call shape, and the call sits inside except Exception → a signature change in 0.3.0 surfaces only as a logged warning in the warm sweep. Either add a test pinning the 4-tuple, or state in the comment why crossing 0.3 is safe — and fix both comments so they stop describing a bound that no longer exists.
  2. trust_cached_entries: true probably neuters just warm-references. scripts/warm_reference_cache.py:28 still passes conf/reference_validator_config.yaml, and that script's docstring (:5-10) states its purpose as the exact behaviour the flag suppresses: "When a cached entry has no full text yet, the validator re-fetches it every run … Running the validator once over the whole corpus with full-text fetching on … populates the cache." This PR's own new test is suggestive evidence that trust short-circuits the fetch: tests/test_reference_cache.py:58-80 builds an abstract-only entry with no extractor_version, calls validator.fetcher.fetch("PMID:1"), and asserts p.read_bytes() == before. Please confirm 0.3.0's semantics; if trust suppresses re-fetch for any already-present entry, give the warming path (and the nightly warm-reference-cache.yaml) a config without the flag — warming is the one place deliberate refetch is the intent.
  3. scripts/run_reference_validator.sh:13 still says "Requires linkml-reference-validator >= 0.2.1". Floor is now 0.3.0.

🔵 SUGGESTIONs

  1. The same defect class survives elsewhere, just under the regex. conf/reference_validator_config.yaml:63 sets literal_bracket_patterns: ["[^a-zA-Z\\s]"] — intended for [2Fe-2S]/[Ca2+], but it also exempts any bracket-only pseudo-quote containing a digit, hyphen or slash. That is why genes/ANOGA/TEP10/TEP10-ai-review.yaml:122 ('[This is a curator assessment based on comparison of domain-function mapping …]'), genes/worm/cebp-2/cebp-2-ai-review.yaml:409 ('[InterPro2GO mapping]') and :42 ('[Phylogenetic inference from C/EBP orthologs …]') are untouched in files you otherwise cleaned. Not a blocker for this PR, and fixing it corpus-wide is a separate sweep — but worth noting that the cleanup is "what 0.3.0 catches", not "the file is now free of pseudo-quotes". A follow-up issue would be the honest bookkeeping.
  2. Statements were deleted along with their fake quotes. supporting_text is optional on both Finding and SupportingTextInReference, so findings: [{statement: …}] with no quote was available where the statement had content (e.g. cebp-2's GO_REF:0000033 → "Phylogenetic inference from C/EBP family members in mammals and other metazoans"). Most of the deleted statements were content-free restatements, so findings: [] is fine; just flagging the cheaper option for next time.
  3. Previous 🔵s still open and still non-blocking: restore @pytest.mark.parametrize("newline", ["\n", "\r\n"]) on test_in_process_title_quote_and_cache_preservation (CRLF is the case the deleted backport existed for); only escalate session.exitstatus in tests/conftest.py:625 when it is OK; use a symmetric set difference at tests/conftest.py:615.

False alarm worth recording

genes/ARATH/CHL1/CHL1-ai-review.yaml:175 has a literally empty supporting_text: '' and was not in CI's error list — correctly, because :176 carries full_text_unavailable: true and scripts/run_reference_validator.sh strips those before validation. No action needed; noting it so it isn't "fixed" by mistake later.


Verdict: still requesting changes — on the three unaddressed 🟡 items (the two contradictory <0.3 comments, and the unresolved trust_cached_entries × warm-references interaction, which is the one that could silently break the nightly cache warm). The 🔴 from the last round looks genuinely addressed and correctly addressed; I just can't certify it until step 15 reports.
· branch claude/confident-shannon-vfz0tz

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 4b68790 (snippet cleanup). The snippet cleanup is correct: 22 placeholder snippets removed across the 11 flagged files, and in every supported_by deletion the removed entry pointed at the same GO_REF already on original_reference_id, so no provenance was lost. Both genuine replacements verified verbatim — SFT2D3:80-81 matches SFT2D3-uniprot.txt:120 exactly (and citing the DR line is better than the old GO_REF:0000117 pseudo-quote), and WIPF1:928-929 matches WIPF1-deep-research-falcon.md:174. History coverage is complete (11 records, one per edited gene).

Still requesting changes on three items from the last round that no commit addressed:

  1. pyproject.toml:49-51 keeps the comment '<0.3: publication_warm.py calls LRV private ReferenceFetcher._materialize; lift the bound once a public API lands' directly above '>=0.3.0,<0.4'. publication_warm.py:401 still calls fetcher._materialize and unpacks a 4-tuple inside an except Exception, and :397-398 still says 'pyproject bounds LRV <0.3 until it lands'. No test pins the call shape. Add a test or justify crossing 0.3, and fix both comments.

  2. trust_cached_entries likely neuters just warm-references. scripts/warm_reference_cache.py:28 still passes conf/reference_validator_config.yaml, whose stated purpose (docstring :5-10) is the behaviour the flag suppresses. This PR's own test (tests/test_reference_cache.py:58-80: abstract-only entry, no extractor_version, fetch, then assert bytes unchanged) is suggestive that trust short-circuits the fetch. Please confirm 0.3.0 semantics; if so, give the warming path and the nightly warm-reference-cache workflow a config without the flag.

  3. scripts/run_reference_validator.sh:13 still says 'Requires linkml-reference-validator >= 0.2.1'.

Also note I cannot certify the gate: Build and test 38045976514 is still on step 15 (Validate gene reviews, whole corpus) after ~55 min, nothing failed yet but step 27 Run test suite has not started, so this PR's new tests remain unverified in CI.

Non-blocking: conf/reference_validator_config.yaml:63 literal_bracket_patterns exempts any bracket-only pseudo-quote containing a digit/hyphen/slash, which is why TEP10:122, cebp-2:409 and cebp-2:42 survive in files you otherwise cleaned — worth a follow-up issue so the cleanup is not read as 'these files are now free of pseudo-quotes'. supporting_text is optional on Finding, so statements with real content could have been kept without a quote. Earlier suggestions still open: restore the CRLF parametrization on test_in_process_title_quote_and_cache_preservation; only escalate session.exitstatus when it is OK; symmetric set difference in the conftest guard.

(For the record: genes/ARATH/CHL1/CHL1-ai-review.yaml:175 has an empty supporting_text but is correctly not an error — :176 sets full_text_unavailable: true, which run_reference_validator.sh strips before validation.)

Full detail: #4552 (comment)

@ai4c-reviewer

ai4c-reviewer Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 4m 47s —— View job


Re-review (round 3): Upgrade linkml-reference-validator to 0.3.0

Scope note: the new commit is infra-only (7 files: pyproject, two scripts, one config, publication_warm.py, two test files). No curation YAML, GO term, action or core_functions entry changes, so the term/evidence checklist items are N/A, not "passed". No history record is needed for an infra-only commit.

  • Schema validation passes — ⏳ still unreported (see below)
  • All PMIDs verified as real — N/A
  • Supporting text matches publication content — N/A this round (round 2's two replacement quotes were verified verbatim)
  • GO terms correct and specific — N/A
  • Review actions well-justified — N/A
  • Core functions accurately identified — N/A
  • No over-annotation issues missed — N/A

✅ All three 🟡 items from round 2 are addressed

1. The <0.4 bound now has a guard instead of a stale rationale. pyproject.toml:49-51 no longer claims a <0.3 ceiling, and publication_warm.py:393-398 matches it. More importantly the comment's promise is actually backed: tests/test_publication_warm.py:258-270 pins the call shape —

text, fmt, pdf_bytes, error = fetcher._materialize(
    FullTextLocation(text="Stub full text.", format_hint="text")
)
assert (text, fmt, pdf_bytes, error) == ("Stub full text.", "text", None, False)

That is the right scope for a contract test: it fails loudly on an arity or ordering change rather than letting it vanish into the except Exception at :401. The import style matches the neighbouring tests (:238-239), so it's consistent with the file.

2. The warm sweep gets its own untrusted config. conf/reference_validator_warm_config.yaml is byte-identical to conf/reference_validator_config.yaml apart from the header comment and the absent trust_cached_entries, scripts/warm_reference_cache.py:32 points at it, the docstring states the intent (:12-14), and tests/test_reference_cache.py:59-64 + :157 assert both the file's content and the CLI argument. I also traced the other warming path to be sure it wasn't left trusting: just warm-publications → ai-gene-review warm-publications → publication_warm.py:490-493, which constructs ReferenceValidationConfig(email=...) directly and reads neither config file, so it was never affected. The nightly warm-reference-cache.yaml runs just warm-references → the script, so it picks the new config up automatically.

3. scripts/run_reference_validator.sh:13 now reads >= 0.3.0 (trusted-cache ...). ✅

⏳ The gate still has not reported (not a finding against the code)

Build and test 38049943271 is only on step 5 of 28 (Fetch benchmark baseline) after ~1h of queue/setup; step 15 Validate gene reviews (scoped) — widened to all ~6,600 files because src/ changed — and step 27 Run test suite have not started. The previous run (38045976514) was superseded by this push before step 15 landed, so on this branch the reference phase has never once completed, and neither has the test suite that covers every test this PR adds. Nothing has failed; it simply hasn't been certified. I can't pre-empt it locally — this sandbox has no uv, no resolved venv, and no network, so I could verify neither the validator run nor the two LRV behaviours below.

🔵 SUGGESTIONs

  1. One thing I could not verify, worth a one-line confirmation: does --config replace the auto-discovered .linkml-reference-validator.yaml, or merge over it? The warm sweep runs from the repo root, where .linkml-reference-validator.yaml:5 still sets trust_cached_entries: true. If LRV merges the project dotfile under the explicit --config, the new warm config is a no-op and the weekly sweep silently stops upgrading abstract-only entries — a quiet failure that PR CI never exercises. Explicit-wins is the normal CLI semantics and is very likely what happens, which is why this is a 🔵 and not a blocker, but the cheap close is an effective-behaviour assertion rather than an argv assertion: build the validator in a tmp cache from the warm config and show that an entry with no extractor_version is considered stale (the exact inverse of test_in_process_title_quote_and_cache_preservation). Incidentally the dotfile also carries email and download_supplementary_files: true, which neither conf/ config sets — if --config does fully replace it, the warm sweep is fetching NCBI without a contact address. That asymmetry predates this PR.
  2. Nothing stops the two configs drifting. They are identical except the trust flag today; a skip_prefixes entry added to one only would diverge silently. test_warm_config_refreshes_stale_cache_entries could assert equality-modulo-trust_cached_entries instead of just cache_dir.
  3. The contract test pins error to exactly False. The consumer only does if error: (publication_warm.py:412), so a 0.3.x patch returning None/"" would redden the test without any real breakage. assert not error plus the arity/text/format assertions keeps the guard and loses the brittleness. Also: the inline-text branch is the only one covered, so a change to the download/sniff branch's return shape would still slip past.
  4. Still open from earlier rounds, all non-blocking: restore @pytest.mark.parametrize("newline", ["\n", "\r\n"]) on test_in_process_title_quote_and_cache_preservation (CRLF is the exact case the deleted backport existed for); only escalate session.exitstatus in tests/conftest.py:625 when it is ExitCode.OK, so an INTERNALERROR/INTERRUPTED run isn't downgraded; use a symmetric set difference at :615 so a test that reverts a pre-existing modification gets named instead of producing the vague "(status changed for already-modified files)".
  5. From round 2 and still true: conf/reference_validator_config.yaml:63's literal_bracket_patterns: ["[^a-zA-Z\\s]"] exempts any bracket-only pseudo-quote containing a digit, hyphen or slash, which is why genes/ANOGA/TEP10:122, genes/worm/cebp-2:409 and :42 survive in files otherwise cleaned. The cleanup is "what 0.3.0 catches", not "these files are free of pseudo-quotes" — worth a follow-up issue so it isn't read as the latter.

Verdict

Approving on the code, with the gate as the outstanding condition. Every item raised in rounds 1 and 2 is now addressed, and addressed in the right way — the private-API bound is guarded by a test rather than by a comment, the warm path has a config whose intent is documented and asserted, and round 2's snippet cleanup removed no provenance (each deleted supported_by entry restated the GO_REF already on original_reference_id). Please don't merge until step 15 and step 27 both report green on 38049943271, since this branch has not yet had a completed reference phase or test run; and ideally confirm 🔵1 before the next Monday-04:00 warm sweep.
· branch claude/confident-shannon-vfz0tz

ai4c-reviewer[bot]
ai4c-reviewer Bot previously approved these changes Oct 10, 2026

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 3: all three 🟡 items from the previous review are addressed, and addressed the right way.

  1. The <0.4 bound now has a guard rather than a stale rationale. pyproject.toml:49-51 and publication_warm.py:393-398 agree, and tests/test_publication_warm.py:258-270 pins the private _materialize 4-tuple so an arity/ordering change fails loudly instead of vanishing into the except Exception at :401.
  2. The warm sweep has its own untrusted config. conf/reference_validator_warm_config.yaml is identical to the validation config apart from the header and the absent trust_cached_entries; warm_reference_cache.py:32 points at it; tests assert both the file content and the CLI argument. I also traced the other warming path to be sure: just warm-publications -> publication_warm.py:490-493 builds ReferenceValidationConfig(email=...) directly and reads neither config file, so it was never affected. The nightly workflow calls just warm-references, so it picks the new config up.
  3. run_reference_validator.sh:13 now says >= 0.3.0.

Outstanding condition, not a finding: the gate has never completed on this branch. Build and test 38049943271 is only on step 5 of 28; step 15 (Validate gene reviews, whole corpus) and step 27 (Run test suite) have not started, and the prior run was superseded before step 15 landed. Please don't merge until both report green. This sandbox has no uv/venv/network, so I could not pre-empt it.

Non-blocking suggestions: (a) confirm that --config replaces rather than merges over the auto-discovered .linkml-reference-validator.yaml, which still sets trust_cached_entries: true at the repo root — if it merges, the new warm config is a no-op and the weekly sweep silently stops upgrading abstract-only entries; an effective-behaviour assertion (stale entry IS refetched under the warm config) would close it better than the argv assertion. (b) Nothing stops the two configs drifting; assert equality-modulo-trust_cached_entries. (c) The contract test pins error to exactly False while the consumer only does 'if error:' — assert not error is less brittle, and only the inline-text branch is covered. (d) Earlier suggestions still open: restore the CRLF parametrization on test_in_process_title_quote_and_cache_preservation; only escalate session.exitstatus when it is ExitCode.OK; symmetric set difference at conftest.py:615. (e) literal_bracket_patterns still exempts bracket-only pseudo-quotes containing a digit/hyphen/slash (TEP10:122, cebp-2:409, :42) — worth a follow-up issue so the cleanup is not read as 'these files are free of pseudo-quotes'.

Full detail: #4552 (comment)

Conflicts were limited to 11 gene reviews whose empty LRV 0.3 evidence
snippets were fixed twice: by 4b68790 on this branch and by #4949 on
main. Take main's merged version of each and drop 4b68790's history
records, which describe the superseded edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SfBE3uVPNyHBBofmRvNakd
@ai4c-reviewer

ai4c-reviewer Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Claude finished @cmungall's task in 4m 55s —— View job


Re-review (round 4): Upgrade linkml-reference-validator to 0.3.0

Scope note: the only new commit is the merge fafc90877. The PR diff is infra-only again (22 files; no *-ai-review.yaml, module or GO-CAM content), because #4949 landed the snippet cleanup on main independently. So the GO-term / action / core_functions checklist items are N/A, not "passed".

  • Schema validation passes — ✅ certified at 065fcd5a4; ⏳ re-running on the merged tree (see below)
  • All PMIDs verified as real — N/A
  • Supporting text matches publication content — N/A this round (round 2's two replacement quotes verified verbatim; they now arrive via Replace 18 empty or editorial-only evidence snippets for LRV 0.3 #4949)
  • GO terms correct and specific — N/A
  • Review actions well-justified — N/A
  • Core functions accurately identified — N/A
  • No over-annotation issues missed — N/A

✅ Round 3's outstanding condition is resolved — the gate did complete, green

Run 38049943271 (commit 065fcd5a4) finished with job test (3.12) success, and the two steps I flagged as never-having-reported both passed:

15 success  Validate gene reviews (scoped)   <- widened to just validate-all (infra change)
27 success  Run test suite

So the whole-corpus reference phase under LRV 0.3.0 has now completed cleanly, and every test this PR adds — the conftest.py protected-tree guard, test_seed_missing_annotations_uses_given_publications_dir, the trust_cached_entries assertions, and the _materialize contract test — is verified in CI. That retires the "never certified on this branch" caveat from rounds 2 and 3.

✅ The merge conflict resolution is correct, and no provenance was lost

The merge commit message is accurate: the 11 gene reviews were fixed twice (by 4b6879075 here, by #4949 on main), resolved to main's version, and 4b6879075's 11 history records were dropped. I verified each claim:

  • The 11 gene folders are now byte-identical to main — git diff origin/main HEAD over genes/ANOGA/TEP10 … genes/worm/pink-1 is empty. No half-merged hybrid of the two cleanups, and no conflict markers anywhere in the tree.
  • History coverage survives via Replace 18 empty or editorial-only evidence snippets for LRV 0.3 #4949. Every one of the 11 genes carries a 2026-10-12T0938..Z-codex-*.yaml record (e.g. history/genes/worm/cebp-2/2026-10-12T093804Z-codex-7ac3ea.yaml), and none of the branch's superseded records (…T1033..Z-codex-{28ac9f,38176f,560208,30851d,a16938,ea4767,d5f908,aa64e2,9b7ff9,4c5c63,39c356}) is left orphaned in history/.
  • Dropping them is the right call under the append-only rule, which governs records that have landed. These 11 never reached main; they describe diffs that no longer exist in the files, so keeping them would have asserted edits the tree doesn't contain — and target.superseded_by is for renames, not for a superseded edit. Nothing to fix here.
  • All round-3 infra fixes came through the merge intact: pyproject.toml still carries >=0.3.0,<0.4 with the rewritten rationale, conf/reference_validator_warm_config.yaml is still present and still trust_cached_entries-free, scripts/warm_reference_cache.py:32 still points at it, and run_reference_validator.sh:13 still reads >= 0.3.0.

⏳ One genuinely new risk: the merged corpus has never seen 0.3.0

The green step 15 above certifies the pre-merge corpus. The merge brought in ~5,500 changed files of curation content from main, all of which has only ever been validated against LRV 0.2.1 — so run 38273000945 is a fresh gate, not a re-run of a known-green one. It will widen correctly (.github/workflows/main.yaml:237-239: infra == true → just validate-all), and #4940's merge-queue change only touched the schema-batch step, so the reference phase scoping is unaffected.

I proxy-scanned the merged tree myself, and it looks clean for both new error classes:

  • Literally-empty supporting_text: exactly one corpus-wide, genes/ARATH/CHL1/CHL1-ai-review.yaml:175, which still carries full_text_unavailable: true at :176 → stripped by run_reference_validator.sh before validation. Same false alarm I recorded in round 2; still not a defect.
  • Bracket-only pseudo-quotes: 13 single-line + 4 block-scalar, and every one is exempted by literal_bracket_patterns: ["[^a-zA-Z\\s]"] because it contains a digit, hyphen, period, slash or semicolon — genes/worm/cebp-2:423, genes/mouse/Notch1:3668,5500,5518,5528, genes/mouse/Ifi204:981,1015, genes/mouse/App:4545,4554,4561, genes/mouse/Sox2:2274,2291,2308, genes/MAIZE/A0A804UIX9:80, genes/SCHPO/tim10:264,347, genes/AQUCT/A0A2G9RZF1:147.

Caveat on that scan: it is ripgrep, not the validator — this sandbox still has no uv, no resolved venv and no network — and it does not cover every YAML shape (multi-bracket block scalars with ... separators, or the module/GO-CAM/family paths). Reassuring, not certifying.

🔵 SUGGESTIONs

  1. That scan is the strongest version yet of the standing literal_bracket_patterns point. The exemption is now visibly carrying a population of pure narrator commentary that quotes nothing at all — genes/mouse/App/App-ai-review.yaml:4545 is '[Falcon synthesis describes APP as a receptor-like scaffold integrating adhesion-like interactions, trafficking, synaptic regulation, and fragment-mediated signaling.]', and genes/SCHPO/tim10:347 is '[No S. pombe-specific experimental papers on tim10 were identified …]' — in a file this PR's predecessor had already "cleaned". Each survives only because of a stray period or hyphen. Still not a blocker for this PR and still a separate sweep, but the follow-up issue is now worth filing with these line references in it, so the cleanup isn't later read as "the corpus is free of pseudo-quotes".
  2. Carried forward unchanged from round 3, all non-blocking: confirm --config replaces rather than merges over the auto-discovered .linkml-reference-validator.yaml (which still sets trust_cached_entries: true at the repo root, and also carries the email the warm config lacks) — an effective-behaviour assertion that a stamp-less entry is refetched under the warm config would close it better than the argv assertion; assert the two conf/ configs are equal-modulo-trust_cached_entries so they can't drift; relax the contract test's error == False to assert not error; restore the ["\n", "\r\n"] parametrization on test_in_process_title_quote_and_cache_preservation; only escalate session.exitstatus in tests/conftest.py:625 when it is ExitCode.OK; use a symmetric set difference at :615.

Verdict

Approving on the code. Nothing new to request: the merge is a clean resolution that preserves both the infra work and the #4949 provenance, and round 3's one outstanding condition turned out to have been satisfied — step 15 and step 27 both went green at 065fcd5a4. The remaining condition is mechanical rather than a finding: let 38273000945 report green before merging, since the merged corpus is content main has only ever validated under 0.2.1. My own scan suggests it will pass.
· branch claude/confident-shannon-vfz0tz

@ai4c-reviewer ai4c-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 4: approving on the code. The only new commit is the merge of origin/main, and it is a clean resolution.

Round 3's one outstanding condition is resolved: run 38049943271 (commit 065fcd5) completed with job test (3.12) success, and both steps I had flagged as never-reporting passed — step 15 'Validate gene reviews (scoped)' (widened to just validate-all by the infra change) and step 27 'Run test suite'. So the whole-corpus LRV 0.3.0 reference phase has now completed cleanly and every test this PR adds is verified in CI.

The merge conflict resolution checks out. The 11 gene reviews fixed twice (by 4b68790 here and by #4949 on main) are now byte-identical to main — git diff origin/main HEAD over those folders is empty, and there are no conflict markers in the tree. History coverage survives via #4949: each of the 11 genes carries a 2026-10-12T0938..Z-codex record, and none of the branch's superseded T1033..Z records is left orphaned. Dropping those is correct: the append-only rule governs records that have landed, and these never reached main — keeping them would assert edits the files no longer contain. All round-3 infra fixes came through intact (>=0.3.0,<0.4 with the rewritten rationale, the trust-free warm config and the script pointing at it, the >= 0.3.0 header).

One genuinely new risk, mechanical rather than a finding: the green step 15 certifies the pre-merge corpus, and the merge brought in ~5,500 changed files of curation content that main has only ever validated under 0.2.1. So run 38273000945 is a fresh gate — please let it report green before merging. It will widen correctly (main.yaml:237-239), and #4940 only touched the merge-queue schema-batch step. My own ripgrep scan of the merged tree suggests it will pass: exactly one literally-empty supporting_text corpus-wide (ARATH/CHL1:175, which carries full_text_unavailable: true and is stripped), and all 17 bracket-only pseudo-quotes I can find are exempted by literal_bracket_patterns because each contains a digit, hyphen, period or semicolon. That is ripgrep, not the validator — no uv/venv/network in this sandbox — so reassuring, not certifying.

Suggestions only, none blocking: (a) the scan sharpens the standing literal_bracket_patterns point — the exemption visibly carries pure narrator commentary that quotes nothing, e.g. mouse/App:4545 '[Falcon synthesis describes APP as a receptor-like scaffold...]' and SCHPO/tim10:347 '[No S. pombe-specific experimental papers on tim10 were identified...]', the latter in a file the predecessor commit had already cleaned; worth filing the follow-up issue with these line refs so the cleanup is not later read as 'the corpus is free of pseudo-quotes'. (b) Carried forward from round 3: confirm --config replaces rather than merges over the root .linkml-reference-validator.yaml (which still sets trust_cached_entries: true and carries the email the warm config lacks), ideally via an effective-behaviour assertion that a stamp-less entry IS refetched under the warm config; assert the two conf/ configs equal-modulo-trust_cached_entries; relax 'error == False' to 'assert not error'; restore the CRLF parametrization; only escalate session.exitstatus when it is ExitCode.OK; symmetric set difference at conftest.py:615.

Full detail: #4552 (comment)

@ai4c-agent

ai4c-agent Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🐑 PR Shepherd (action run) — Attempted to repair this approved-but-conflicting branch with a local merge from main (no rebase, no force-push). The conflicts are not safely resolvable by me, so I pushed nothing — the branch is untouched.

What I ran

git merge origin/main into fafc9087 produces 10 conflicted paths:

  • content — conf/reference_validator_config.yaml, pyproject.toml, scripts/extract_supporting_text_fixes.py, scripts/mark_full_text_unavailable.py, scripts/run_reference_validator.sh, scripts/warm_reference_cache.py, src/ai_gene_review/etl/publication_warm.py, uv.lock
  • modify/delete — src/ai_gene_review/validation/reference_cli.py: deleted on this branch, modified on main
  • rename/rename — tests/test_reference_cache_compat.py renamed to tests/test_reference_cache.py here and to tests/test_reference_cache_behavior.py on main

Why it is blocked: the same upgrade landed on main independently

The merge base is 00d0f98ed7 (#4949), and the only commit on main since then that touches these paths is e2057e8b40 — "Upgrade LRV to 0.3.1rc1 and remove cache-loader monkeypatch" (#4947, 2026-10-13). main now pins linkml-reference-validator>=0.3.1rc1,<0.4 where this branch pins >=0.3.0,<0.4, keeps reference_cli.py rather than deleting it, and has already taken the compat-test rename in its own direction.

So these are not stale-branch mechanics — they are two competing implementations of the same upgrade. Every conflict hunk is a choice between this branch's 0.3.0 design and the 0.3.1rc1 design already shipped, and reference_cli.py (delete vs. keep) and the test rename are architectural calls, not text merges. Picking either side mechanically would silently revert part of a merged PR or drop part of this one.

What still looks unique to this branch

conf/reference_validator_warm_config.yaml (added here, absent from main), plus the publications_dir plumbing in etl/gene.py / goa_validator.py and the tests/conftest.py isolation work. If the decision is that #4947 supersedes this PR, that delta is probably what is worth salvaging into a fresh branch off current main.

Needs a maintainer decision — close as superseded by #4947, or re-cut the remaining delta against main. Either way the approval here is pinned to a design that main has since moved past, so I have not touched the branch, the approval, or the merge state.

Copy link
Copy Markdown
Member Author

Closing as superseded. main now pins linkml-reference-validator 0.3.1rc1, has removed the 0.2.1 cache-delimiter backport, and sets trust_cached_entries: true in conf/reference_validator_config.yaml. The duplicated evidence-snippet cleanup landed in #4949.

The one part of this branch not on main is test isolation: integration tests that write into the committed publications/. It is being re-opened as a small PR from current main.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants